/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * ParetoPanel.java
 *
 * Created on Jun 3, 2010, 5:22:48 PM
 */

package gui.panels;

/**
 *
 * @author andreazagnoli
 */
public class ParetoPanel extends javax.swing.JPanel {

	private static final long serialVersionUID = 1L;

	/** Creates new form ParetoPanel */
    public ParetoPanel() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        alfa = new javax.swing.JTextField();
        jLabel1 = new javax.swing.JLabel();

        setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Additional Parameters", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.ABOVE_TOP));

        jLabel1.setText("alfa");

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(12, 12, 12)
                .add(jLabel1)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(alfa, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 57, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(64, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                .add(jLabel1)
                .add(alfa, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
        );
    }// </editor-fold>//GEN-END:initComponents

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField alfa;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
    
    public boolean checkParameters() {
    	if (alfa.getText() == "")
    		return false;
    	try {
    		double a = Double.parseDouble(alfa.getText());
    		return a>1;
    	}
    	catch (NumberFormatException e) {
    		return false;
    	}
    }
    
    public double getAlfa() {
    	try {
    		return Double.parseDouble(alfa.getText());
    	}
    	catch (NumberFormatException e) { }
    	return -1;
    }

}
